package swing;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JProgressBar;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;

public class FileCopy extends JFrame{
	private JTextField[] tf=new JTextField[2];
	private JButton[] bt=new JButton[2];
	private JProgressBar pb;
	public FileCopy() {
		setTitle("文件复制");
		setSize(500,500);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		setVisible(true);
		setLayout(null);
		String[] str={"源文件","目的地"};
		int y=30;
		for(int i=0;i<str.length;i++){
			JLabel label=new JLabel(str[i]);
			label.setBounds(50, y, 100, 25);
			add(label);			
			tf[i]=new JTextField();
			tf[i].setBounds(150, y, 200, 25);
			add(tf[i]);
			bt[i]=new JButton("请选择");
			bt[i].setBounds(370, y, 80, 25);
			add(bt[i]);
			y+=50;
			
					
			
		}
		JButton copy=new JButton("复制");
		copy.setBounds(200, y+200, 100, 25);
		add(copy);
		pb=new JProgressBar(0,100);
		pb.setStringPainted(true);
		pb.setValue(30);
		pb.setBounds(50, y+100, 380, 25);
		add(pb);
				
		
	}
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {			
			@Override
			public void run() {
				new FileCopy();
				
			}
		});
	}

}
